package sctu.edu.java.year2016.team02.zhoujie.day20160523.chapter6_2;

/**
 * Created by ACER on 2016/5/25.
 */
/*前面介绍了去除字符串中所有空格的两种方法，试着不利用这两种方法，只用for循环和if条件语句去除空格*/
public class DeleteBlank {
    public static void main(String[] args) {
        String c = "I am a student";
        System.out.println(c);
        for (int i = 0; i < c.length(); i++) {
            if (c.charAt(i) != ' ')
                System.out.print(c.charAt(i));
        }
    }
}

